import { createApp } from 'vue'
import { createPinia } from 'pinia'

import ElementPlus from 'element-plus'


import TopSearch from '@/components/TopSearch/index.vue'
import FouImage from "@/components/foundation/FouImage.vue";
import FouDialog from "@/components/foundation/FouDialog.vue";
import FouDrawer from "@/components/foundation/FouDrawer.vue";
import ExcelFooter from "@/components/ExcelFooter/index.vue";
import DateControls from '@/components/DateControls/index.vue'

import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
const app = createApp(App)
// css
import 'virtual:windi.css'
import '@/assets/main.css'//:root
//icon
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

//fwb     https://vueup.github.io/vue-quill/guide/toolbar.html
import { QuillEditor } from '@vueup/vue-quill'
import '@vueup/vue-quill/dist/vue-quill.snow.css';
// fwb2   https://www.kancloud.cn/liuwave/quill/1409373   不需引入
// import VueQuillEditor from 'vue-quill-editor'
// import 'quill/dist/quill.core.css'
// import 'quill/dist/quill.snow.css'
// import 'quill/dist/quill.bubble.css'
// app.use(VueQuillEditor, /* { default global options } */)

const from = import.meta.globEager('@/components/Pro*/index.vue')
for (const key in from) {
    // app.component(from[key].default.__name, from[key].default)
    app.component(key.split('/')[3],from[key].default )
}
import permission from "./common/permission.js"
app.use(permission)
import selectLoadMore from './common/select.js'
app.use(selectLoadMore)

app.component('QuillEditor', QuillEditor)
app.use(createPinia())
app.use(ElementPlus)
app.use(router)
app.mount('#app')


app.component('TopSearch', TopSearch)
app.component('FouImage', FouImage)
app.component('FouDialog', FouDialog)
app.component('FouDrawer', FouDrawer)
app.component('ExcelFooter', ExcelFooter)
app.component('DateControls', DateControls)

